package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 水质数据统计表
 * @TableName water_quality_statistics
 */
@TableName(value ="water_quality_statistics")
@Data
public class WaterQualityStatistics implements Serializable {
    /**
     * 统计ID
     */
    @TableId(type = IdType.AUTO)
    private Long statId;

    /**
     * 设备ID
     */
    private Long deviceId;

    /**
     * 统计日期
     */
    private Date statDate;

    /**
     * 统计类型：1-日统计，2-周统计，3-月统计
     */
    private Integer statType;

    /**
     * 指标编码
     */
    private String indicatorCode;

    /**
     * 平均值
     */
    private BigDecimal avgValue;

    /**
     * 最大值
     */
    private BigDecimal maxValue;

    /**
     * 最小值
     */
    private BigDecimal minValue;

    /**
     * 数据数量
     */
    private Integer dataCount;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WaterQualityStatistics other = (WaterQualityStatistics) that;
        return (this.getStatId() == null ? other.getStatId() == null : this.getStatId().equals(other.getStatId()))
            && (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getStatDate() == null ? other.getStatDate() == null : this.getStatDate().equals(other.getStatDate()))
            && (this.getStatType() == null ? other.getStatType() == null : this.getStatType().equals(other.getStatType()))
            && (this.getIndicatorCode() == null ? other.getIndicatorCode() == null : this.getIndicatorCode().equals(other.getIndicatorCode()))
            && (this.getAvgValue() == null ? other.getAvgValue() == null : this.getAvgValue().equals(other.getAvgValue()))
            && (this.getMaxValue() == null ? other.getMaxValue() == null : this.getMaxValue().equals(other.getMaxValue()))
            && (this.getMinValue() == null ? other.getMinValue() == null : this.getMinValue().equals(other.getMinValue()))
            && (this.getDataCount() == null ? other.getDataCount() == null : this.getDataCount().equals(other.getDataCount()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getStatId() == null) ? 0 : getStatId().hashCode());
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getStatDate() == null) ? 0 : getStatDate().hashCode());
        result = prime * result + ((getStatType() == null) ? 0 : getStatType().hashCode());
        result = prime * result + ((getIndicatorCode() == null) ? 0 : getIndicatorCode().hashCode());
        result = prime * result + ((getAvgValue() == null) ? 0 : getAvgValue().hashCode());
        result = prime * result + ((getMaxValue() == null) ? 0 : getMaxValue().hashCode());
        result = prime * result + ((getMinValue() == null) ? 0 : getMinValue().hashCode());
        result = prime * result + ((getDataCount() == null) ? 0 : getDataCount().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", statId=").append(statId);
        sb.append(", deviceId=").append(deviceId);
        sb.append(", statDate=").append(statDate);
        sb.append(", statType=").append(statType);
        sb.append(", indicatorCode=").append(indicatorCode);
        sb.append(", avgValue=").append(avgValue);
        sb.append(", maxValue=").append(maxValue);
        sb.append(", minValue=").append(minValue);
        sb.append(", dataCount=").append(dataCount);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}